<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <canvas
      id="myCanvas"
      style="border: 1px solid #d3d3d3"
      width="600"
      height="600"
    ></canvas>
    <!-- 作业4 -->
    <!-- <script>
      // 获取canvas元素
      var canvas = document.getElementById("myCanvas");
      // 获取上下文
      var ctx = canvas.getContext("2d");
      //   文本输入
      //   ctx.font="20px Arial";
      //   ctx.fillStyle="green";
      //   ctx.fillText("hello",100,100);

      // 文本描边
      ctx.font = "30px Arial";
      ctx.strokeStyle = "red";
      ctx.strokeText("hello", 100, 100);
    </script> -->

    <!-- 作业5 -->
    <script>
      // 获取canvas元素
      var canvas = document.getElementById("myCanvas");
      // 获取上下文
      var ctx = canvas.getContext("2d");
      //   文本输入
      ctx.font = "20px Arial";
      ctx.fillStyle = "green";
      ctx.fillText("滚蛋把八阿哥", 50, 50);
    </script>
  </body>
</html>
